import java.awt.* ;
import java.awt.List;
import java.awt.event.* ;
import java.util.*;
import javax.swing.* ;


public class OptionSelectionDialog extends JPanel{
	
	private JLabel titleLabel;
	private JLabel jLabel1;
	private JLabel jLabel2;
	private JTextField jTextField1;
	private JButton jButton;
	private JRadioButton findRestaurantButton;
	private JRadioButton savedProfilesButton;
	private JRadioButton addRestaurantButton;
	private JRadioButton editRestaurantButton;
	private JRadioButton deleteRestaurantButton;
	private ButtonGroup group = new ButtonGroup();	
	//private domainLogic dL;
	
	
	public OptionSelectionDialog(boolean userLogged, boolean adminLogged){
		this.setLayout(new GridLayout(0,1));
	//	this.setPreferredSize(new Dimension(100,200));
		//this.setMinimumSize(new Dimension(150,75));
//		this.setMaximumSize(new Dimension(300,400));
		jLabel1 = new JLabel("Choose and option:");
		this.add(jLabel1);
	
		
		 findRestaurantButton = new JRadioButton("Find Restaurant");
		 //findRestaurantButton.setActionCommand("Find Restaurant");
		 savedProfilesButton = new JRadioButton("Saved Preference Profiles");
		 addRestaurantButton = new JRadioButton("Add Restaurant");
		 editRestaurantButton = new JRadioButton("Edit Restaurant");
		 deleteRestaurantButton = new JRadioButton("Delete Restaurant");
		 if(!userLogged){
			 savedProfilesButton.setVisible(false);
		 }
		 if(!adminLogged){
			 addRestaurantButton.setVisible(false);
			 editRestaurantButton.setVisible(false);
			 deleteRestaurantButton.setVisible(false);
		 }		 
		 
		// findRestaurantButton.setActionCommand("Find Restaurant");
  	    
		 //group.add(findRestaurantButton);
		 //group.add(savedProfilesButton);
		 //Register a listener for the radio buttons.
		 this.add(findRestaurantButton);	
		 this.add(savedProfilesButton);
		 this.add(addRestaurantButton);
		 this.add(editRestaurantButton);
		 this.add(deleteRestaurantButton);
	}
		//ArrayList<Component> contents = new ArrayList<Component>();
		
/*
	public void signIn() {
		jButton.setText("Sign out");
		jTextField1.setText(jTextField1.getText());
		jTextField1.setEditable(false);
		jLabel1.setText("Log out");
		//bool signedIn = dL.signIn(username, password);
	}
	
	public void signOut() {
		jButton.setText("Sign In");
		jTextField1.setEditable(true);
		jLabel1.setText("Log In");
	}


	*/
	public ButtonGroup getRadioButtons(){
		return group;
	}
	
	public JRadioButton findRestaurantButton(){
		return findRestaurantButton;
	}
	
	public JRadioButton savedProfilesButton(){
		return savedProfilesButton;
	}
	
	public JRadioButton addRestaurantButton(){
		return addRestaurantButton;
	}	
	
	public JRadioButton editRestaurantButton(){
		return editRestaurantButton;
	}	
	
	public JRadioButton deleteRestaurantButton(){
		return deleteRestaurantButton;
	}	
	
	public void showSavedProfileOption(boolean logged){
		savedProfilesButton.setVisible(logged);
	}

	public void showAddRestaurantOption(boolean logged){
		addRestaurantButton.setVisible(logged);
	}
	
	public void showEditRestaurantOption(boolean logged){
		editRestaurantButton.setVisible(logged);
	}
	
	public void showDeleteRestaurantOption(boolean logged){
		deleteRestaurantButton.setVisible(logged);
	}
}